<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1"><title id="db20941">DROP OWNED</title><body><p id="sql_command_desc">Removes database objects owned by a database role.</p><section id="section2"><title>Synopsis</title><codeblock id="sql_command_synopsis">DROP OWNED BY <varname>name</varname> [, ...] [CASCADE | RESTRICT]</codeblock></section><section id="section3"><title>Description</title><p><codeph>DROP OWNED</codeph> drops all the objects in the current database
that are owned by one of the specified roles. Any privileges granted
to the given roles on objects in the current database or on shared objects (databases, tablespaces) will also be revoked.</p></section><section id="section4"><title>Parameters</title><parml><plentry><pt><varname>name</varname></pt><pd>The name of a role whose objects will be dropped, and whose privileges
will be revoked.</pd></plentry><plentry><pt>CASCADE</pt><pd>Automatically drop objects that depend on the affected objects.</pd></plentry><plentry><pt>RESTRICT</pt><pd>Refuse to drop the objects owned by a role if any other database
objects depend on one of the affected objects. This is the default.</pd></plentry></parml></section><section id="section5"><title>Notes</title><p><codeph>DROP OWNED</codeph> is often used to prepare for the removal
of one or more roles. Because <codeph>DROP OWNED</codeph> only affects
the objects in the current database, it is usually necessary to run
this command in each database that contains objects owned by a role that
is to be removed.</p><p>Using the <codeph>CASCADE</codeph> option may make the command recurse
to objects owned by other users.</p><p>The <xref href="REASSIGN_OWNED.xml#topic1"><codeph>REASSIGN OWNED</codeph></xref> command is an
        alternative that reassigns the ownership of all the database objects owned by one or more
        roles. However, <codeph>REASSIGN OWNED</codeph> does not deal with
          privileges for other objects.
</p></section><section id="section6"><title>Examples</title><p>Remove any database objects owned by the role named <codeph>sally</codeph>:</p><codeblock>DROP OWNED BY sally;</codeblock></section><section id="section7"><title>Compatibility</title><p>The <codeph>DROP OWNED</codeph> command is a Greenplum Database extension. </p></section><section id="section8"><title>See Also</title><p><codeph><xref href="./REASSIGN_OWNED.xml#topic1" type="topic" format="dita"/></codeph>,
            <codeph><xref href="./DROP_ROLE.xml#topic1" type="topic" format="dita"/></codeph></p></section></body></topic>
